package com.pine.app.module.security.oauth.provider.token;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;
import java.util.Date;

/**
 * @author xiaoyuan
 * @create 2019/9/30
 **/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public interface OAuth2AccessToken extends Serializable {

    @JsonProperty("access_token")
    @JSONField(name = "access_token")
    String getAccessToken();

    @JsonProperty("refresh_token")
    @JSONField(name = "refresh_token")
    String getRefreshToken();

    @JsonIgnore
    @JSONField(serialize = false)
    OAuth2RefreshToken getOauth2RefreshToken();


    @JsonIgnore
    @JSONField(serialize = false)
    Date getExpireTime();
    @JsonIgnore
    @JSONField(serialize = false)
    boolean isExpire();


    @JsonProperty("expire_in")
    @JSONField(name = "expire_in")
     Integer getExpiresIn();

    @JsonProperty("token_type")
    @JSONField(name = "token_type")
    String getTokenType();

}
